package com.chengyu.core.controller.member;

import cn.hutool.core.collection.CollectionUtil;
import com.chengyu.core.component.OperationLog;
import com.chengyu.core.controller.UserBaseController;
import com.chengyu.core.domain.CommonConstant;
import com.chengyu.core.domain.form.BankForm;
import com.chengyu.core.domain.form.WithdrawSearchForm;
import com.chengyu.core.domain.result.WithdrawCountResult;
import com.chengyu.core.entity.CommonPage;
import com.chengyu.core.entity.CommonResult;
import com.chengyu.core.exception.ServiceException;
import com.chengyu.core.model.CmsFeedback;
import com.chengyu.core.model.UmsMember;
import com.chengyu.core.model.UmsMemberBank;
import com.chengyu.core.model.UmsMemberWithdraw;
import com.chengyu.core.service.content.FeedbackService;
import com.chengyu.core.service.member.MemberBankService;
import com.chengyu.core.service.member.MemberWithdrawService;
import com.chengyu.core.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;
import java.util.List;

/**
 * @title  提现
 * @author LeGreen
 * @date   2021/1/9
 */
@Api(tags = "提现管理")
@Controller
@RequestMapping("/member")
public class FeebackController extends UserBaseController {

	@Autowired
	private FeedbackService feedbackService;

//	@ApiOperation(value = "意见反馈列表")
//	@ResponseBody
//	@RequestMapping(value="/feedback/getList", method=RequestMethod.GET)
//	public CommonResult<CommonPage<CmsFeedback>> getList(
//			@RequestParam(value = "page", defaultValue = "1") Integer page,
//			@RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize) throws Exception {
//		List<CmsFeedback> list = feedbackService.getFeedbackList(page, pageSize);
//		return CommonResult.success(CommonPage.restPage(list));
//	}
//
//	@OperationLog
//	@ApiOperation(value = "将意见反馈标记为已处理")
//	@ResponseBody
//	@RequestMapping(value="/feedback/updateStatus", method=RequestMethod.POST)
//	public CommonResult<String> updateStatus(Integer id, String status) throws Exception {
//		feedbackService.handleFeedback(id);
//		return CommonResult.success(null);
//	}

	@OperationLog
	@ApiOperation(value = "提交意见反馈")
	@ResponseBody
	@RequestMapping(value="/feedback/save", method=RequestMethod.POST)
	public CommonResult<String> addFeedback(CmsFeedback feedback) throws Exception {
//		CmsFeedback feedback  = new CmsFeedback();

		feedback.setMemberId(getCurrentMemberId());
//		feedback.setImgs(imgs);
//		imgs
//		content

		feedbackService.addFeedback(feedback);
		return CommonResult.success(null);
	}

}
